package tf_rna_hit;

/**
 * 
 * @author ygidtu
 *	用来储存所有bed文件的信息
 */

public class Bed {
	private String name;
	private int start;
	private int end;
	private String strand;
	private String chr;
	private String tag;
	private int realstart;
	private int realend;
	
	// constructors
	public Bed(){
		this.name = null;
		this.start = 0;
		this.end = 0;
		this.strand = null;
		this.chr = null;
		this.tag = null;
	}
	
	public Bed(String chr, int start, int end, String name, String tag, String strand){
		setChr(chr);
		setStart(start);
		setName(name);
		setEnd(end);
		setTag(tag);
		setStrand(strand);		
	}
	
	public Bed(String chr, int start, int end, String name){
		setChr(chr);
		setStart(start);
		setName(name);
		setEnd(end);	
		setStrand(".");
	}
	
	// setters
	public void setName(String name){
		this.name = name;
	}
	
	public void setChr(String chr){
		this.chr = chr;
	}
	
	public void setStart(int start){
		this.start = start;
	}
	
	public void setEnd(int end){
		this.end = end;
	}
	
	public void setTag(String tag){
		this.tag = tag;
	}
	
	public void setStrand(String strand){
		this.strand = strand;
	}
	
	public void setBlock(int start, int end){
		this.realstart = start;
		this.realend = end;
	}
	
	// getters
	public String getName(){
		return this.name;
	}
	
	public String getStrand(){
		return this.strand;
	}
	
	public int getStart(){
		return this.start;
	}
	
	public int getEnd(){
		return this.end;
	}
	
	public String getChr(){
		return this.chr;
	}
	
	public String getTag(){
		return this.tag;
	}
	
	public int getTagint(){
		return Integer.parseInt(this.tag);
	}
	
	public String test(){
		return this.chr + this.start + this.end + this.name + this.tag + this.strand;
	}
	
	public int getrealstart(){
		return this.realstart;
	}
	
	public int getrealend(){
		return this.realend;
	}
	// 输出bed格式
	public String printBed(){
		return this.chr + "\t" + this.start + "\t" + this.end + "\t" + this.name + "\t" + this.tag + "\t" + this.strand;
	}
}
